
package com.epam.android.training.level1.poll;

import com.epam.android.training.level1.UniqueEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Anton Novikau
 */
public class QuestionBo implements UniqueEntity {
  private long id;

  private long pollId;

  private String displayName;

  private List<AnswerBo> answers;

  @Override
  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public long getPollId() {
    return pollId;
  }

  public void setPollId(long pollId) {
    this.pollId = pollId;
  }

  public String getDisplayName() {
    return displayName;
  }

  public void setDisplayName(String displayName) {
    this.displayName = displayName;
  }

  public List<AnswerBo> getAnswers() {
    if (answers == null) {
      answers = new ArrayList<AnswerBo>();
    }

    return answers;
  }

  public void setAnswers(List<AnswerBo> answers) {
    this.answers = answers;
  }

  public void addAnswer(AnswerBo answer) {
    getAnswers().add(answer);
  }

  @Override
  public String toString() {
    return getDisplayName();
  }
}
